package com.wbs.domain.util;

/**
 * Class that is responsible for data pattern
 */
public final class DataPatternUtil {

    private DataPatternUtil(){}

    /**
     * Method that generates a string on a type of case
     */
    public static String buildJpaLikePattern(String content, CaseType caseType ) {
        StringBuilder builder = new StringBuilder();
        builder.append("%");

        if (CaseType.UPPER.equals(caseType)){
            builder.append(content.toUpperCase());
        } else if(CaseType.LOWER.equals(caseType)) {
            builder.append(content.toLowerCase());
        }

        builder.append("%");

        return builder.toString();
    }
}